package com.cbgolf.oa.fragment;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.cbgolf.oa.R;
import com.cbgolf.oa.util.ErrorUtil;
import com.cbgolf.oa.util.ViewUtils;
import com.cbgolf.oa.views.ErrorView;
import com.cbgolf.oa.widget.autolayout.utils.AutoUtil;
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
import org.xutils.view.annotation.ViewInject;

/**
 *
 * @author lq
 * @date 2017/6/30
 */

public class OrderEmptyFragment extends Fragment {

    private View view;
    @ViewInject(R.id.refresh)
    private SmartRefreshLayout refreshLayout;

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        view = getActivity().getLayoutInflater().inflate(R.layout.f_order, null);
        init();
        AutoUtil.auto(view);
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        if (null == view) {
            view = inflater.inflate(R.layout.f_order, null);
            init();
            AutoUtil.auto(view);
        }
        return view;
    }

    private void init() {
        ViewUtils.autoInjectAllField(this, view);
        ErrorView errorView = new ErrorView(getActivity(),view);
        errorView.showError(refreshLayout, ErrorUtil.ORDER_CODE, null);

    }
}
